package com.ervanalb.cellradio.shared.communicator.packets;

import java.nio.ByteBuffer;

public class ErrorPacketData {
	public String message;
	
	public ErrorPacketData(ByteBuffer bb)
	{
		message=PacketData.getString(bb);
	}
	
	public int size()
	{
		return PacketData.strlen(message);
	}

	public ErrorPacketData(String message) {
		this.message=message;
	}
	
	public PacketData pack()
	{
		ByteBuffer bb=ByteBuffer.allocate(size());
		PacketData.putString(bb,message);
		bb.rewind();
		return new PacketData(PacketData.TYPE_ERROR,bb);
	}
}
